package com.example.mapper;

import com.example.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {
    // 查询所有用户
    List<User> selectAll(User user);

    // 查询用户名
    @Select("select * from `user` where username = #{username}")
    User selectByName(String username);

    // 添加用户
    void insert(User user);

    // 修改用户
    void updateById(User user);

    // 删除用户
    @Delete("delete from `user` where id = #{id}")
    void deleteById(Integer id);
}
